﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DreamSpace.Net.Extensions
{
    /// <summary>
    /// DreamSpace Server Extensions, as the name suggests, extends the server abilities (they are DLLs that behave much like "plugins").
    /// They add functionality that cannot be achieved via JavaScript alone, such as accessing the file system, reading from a database, opening socket connections, and more.
    /// <para>Extensions expose themselves as modules to the JavaScript environment using a namespace and type name, and can be easily be instantiated using those names within the scripting environment.
    /// Thus, extensions are ALSO modules; however, not all modules are associated with extensions.  Modules can be pure stand alone JavaScript routines.</para>
    /// <para>As a rule of thumb, if a solution can be written entirely in JavaScript via the existing server abilities, and/or other available extensions, then a JavaScript based MODULE should be created instead.</para>
    /// </summary>
    public interface IDSSExtension
    {
        /// <summary>
        /// All extension developers must give a unique name space to prevent type name conflicts.
        /// Users have the option to drop the name space portion if desired.
        /// <para>Example: typeof(HTTPServerExt).Namespace, or this.GetType().Namespace, or simply "DreamSpace.Net"</para>
        /// <para>(note: normal JavaScript naming convention is to expect the first letter of types to be upper case [i.e. Array, Date, etc.], and the system will auto correct the naming to enforce this)</para>
        /// </summary>
        string TypeNameSpace { get; } //TODO: Auto correct names (first letter as uppercase)

        /// <summary>
        /// The name of the type to associate within the given name space.
        /// <para>Example: typeof(HTTPServerExt).Name, this.GetType().Name, or simply "HTTPServer" (note: the word "Ext"/"Extension", if exists, is removed automatically)</para>
        /// <para>(note: normal JavaScript naming convention is to expect the first letter of types to be upper case [i.e. Array, Date, etc.], and the system will auto correct the naming to enforce this)</para>
        /// </summary>
        string TypeName { get; } //TODO: Auto correct names (first letter as uppercase)
    }
}
